﻿package mortal.game.view.chat.chatPrivate
{
    import Message.Game.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.menu.*;

    public class GuildMemberCellRenderer extends GCellRenderer
    {
        protected var member:SGuildMember;
        protected var tfName:GTextFiled;

        public function GuildMemberCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.tfName = UIFactory.gTextField("", 0, 0, 145, 22, this, GlobalStyle.textFormatPutong);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this.tfName.dispose(param1);
            this.tfName = null;
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:DefInfo = null;
            this.member = param1 as SGuildMember;
            PlayerMenuRegister.UnRegister(this);
            PlayerMenuRegister.Register(this, this.member.miniPlayer, PlayerMenuConst.GuildMemberOnlineOpMenu);
            if (this.member.miniPlayer.online)
            {
                this.tfName.htmlText = GameDefConfig.instance.getGuildPositonHtmlName(this.member.position) + this.member.miniPlayer.name;
            }
            else
            {
                _loc_2 = GameDefConfig.instance.getGuildPositonInfo(this.member.position);
                this.tfName.htmlText = HTMLUtil.addColor(_loc_2.text2 + this.member.miniPlayer.name, GlobalStyle.colorHui);
            }
            return;
        }// end function

    }
}
